﻿<!--
    Copyright © Microsoft Corporation.  All Rights Reserved.
    This code released under the terms of the 
    Microsoft Public License (MS-PL, http://opensource.org/licenses/ms-pl.html.)
-->
    
<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:sys="clr-namespace:System;assembly=mscorlib"
	xmlns:moc="clr-namespace:Microsoft.Expression.Prototyping.Mockups;assembly=Microsoft.Expression.Prototyping.MockupsWPF"
	xmlns:local="clr-namespace:Microsoft.Expression.Prototyping.Mockups.Design.PropertyEditors;assembly=Microsoft.Expression.Prototyping.Mockups.Design.PropertyEditors">
	
	<local:StringToIconImageConverter x:Key="StringToIconImageConverter"/>
	<local:StringToCursorImageConverter x:Key="StringToCursorImageConverter"/>
	<local:StringToOverlayImageConverter x:Key="StringToOverlayImageConverter"/>
	<local:CursorToIconImageConverter x:Key="CursorToIconImageConverter"/>
	<local:OverlayImageToIconImageConverter x:Key="OverlayImageToIconImageConverter"/>

	<ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="IconImageValues">
		<ObjectDataProvider.MethodParameters>
			<x:Type TypeName="moc:IconImage" />
		</ObjectDataProvider.MethodParameters>
	</ObjectDataProvider>

	<DataTemplate x:Key="IconPickerLineTemplate">
		<ComboBox SelectedValue="{Binding StringValue, Converter={StaticResource StringToIconImageConverter}}" ItemsSource="{Binding Source={StaticResource IconImageValues}}">
			<ComboBox.ItemTemplate>
				<DataTemplate>
					<StackPanel Orientation="Horizontal">
						<Canvas Background="Transparent" Width="20" Height="20" ToolTip="{Binding}">
							<moc:IconMockup Width="20" Height="20" IconImage="{Binding}">
								<moc:IconMockup.Resources>
									<Style TargetType="moc:IconMockup">
										<Setter Property="Foreground" Value="White"/>
										<Setter Property="BorderBrush" Value="Black"/>
										<Setter Property="Background" Value="White"/>
										<Style.Triggers>
											<DataTrigger Binding="{Binding}" Value="{x:Static moc:IconImage.Warning}">
												<Setter Property="Foreground" Value="#FF606060"/>
											</DataTrigger>
											<DataTrigger Binding="{Binding}" Value="{x:Static moc:IconImage.CloseFile}">
												<Setter Property="Foreground" Value="#FF606060"/>
											</DataTrigger>
											<DataTrigger Binding="{Binding}" Value="{x:Static moc:IconImage.Folder}">
												<Setter Property="Foreground" Value="#FF606060"/>
											</DataTrigger>
											<DataTrigger Binding="{Binding}" Value="{x:Static moc:IconImage.Home}">
												<Setter Property="Background" Value="#FF606060"/>
											</DataTrigger>
											<DataTrigger Binding="{Binding}" Value="{x:Static moc:IconImage.OpenFile}">
												<Setter Property="Foreground" Value="#FF606060"/>
											</DataTrigger>
											<DataTrigger Binding="{Binding}" Value="{x:Static moc:IconImage.Pencil}">
												<Setter Property="Foreground" Value="#FF606060"/>
											</DataTrigger>
											<DataTrigger Binding="{Binding}" Value="{x:Static moc:IconImage.Pictures}">
												<Setter Property="Foreground" Value="#FF606060"/>
											</DataTrigger>
											<DataTrigger Binding="{Binding}" Value="{x:Static moc:IconImage.RSS}">
												<Setter Property="Foreground" Value="#FF606060"/>
											</DataTrigger>
											<DataTrigger Binding="{Binding}" Value="{x:Static moc:IconImage.SaveFile}">
												<Setter Property="Foreground" Value="#FF606060"/>
											</DataTrigger>
											<DataTrigger Binding="{Binding}" Value="{x:Static moc:IconImage.Share}">
												<Setter Property="Foreground" Value="#FF606060"/>
											</DataTrigger>
											<DataTrigger Binding="{Binding}" Value="{x:Static moc:IconImage.Videos}">
												<Setter Property="Foreground" Value="#FF606060"/>
											</DataTrigger>
											<DataTrigger Binding="{Binding}" Value="{x:Static moc:IconImage.WindowFullScreen}">
												<Setter Property="Foreground" Value="#FF606060"/>
											</DataTrigger>
											<DataTrigger Binding="{Binding}" Value="{x:Static moc:IconImage.WindowMaximize}">
												<Setter Property="Foreground" Value="#FF606060"/>
											</DataTrigger>
										</Style.Triggers>
									</Style>
								</moc:IconMockup.Resources>
							</moc:IconMockup>
						</Canvas>
						<TextBlock Text="{Binding}" Padding="6,4,0,0"/>
					</StackPanel>
				</DataTemplate>
			</ComboBox.ItemTemplate>
			<ComboBox.ItemsPanel>
				<ItemsPanelTemplate>
					<WrapPanel Width="320" ItemHeight="24" ItemWidth="28"/>
				</ItemsPanelTemplate>
			</ComboBox.ItemsPanel>
		</ComboBox>
	</DataTemplate>

	<ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="CursorImageValues">
		<ObjectDataProvider.MethodParameters>
			<x:Type TypeName="moc:CursorImage" />
		</ObjectDataProvider.MethodParameters>
	</ObjectDataProvider>

	<DataTemplate x:Key="CursorPickerLineTemplate">
		<ComboBox SelectedValue="{Binding StringValue, Converter={StaticResource StringToCursorImageConverter}}" ItemsSource="{Binding Source={StaticResource CursorImageValues}}">
			<ComboBox.ItemTemplate>
				<DataTemplate>
					<StackPanel Orientation="Horizontal">
						<Canvas Background="Transparent" Width="20" Height="20" ToolTip="{Binding}">
							<moc:IconMockup  Width="20" Height="20" IconImage="{Binding Converter={StaticResource CursorToIconImageConverter}}" Background ="White" BorderBrush="Black" Foreground="Gray"/>
						</Canvas>
						<TextBlock Text="{Binding}" Padding="8,4,0,0"/>
					</StackPanel>
				</DataTemplate>
			</ComboBox.ItemTemplate>
			<ComboBox.ItemsPanel>
				<ItemsPanelTemplate>
					<WrapPanel Height="280" Orientation="Vertical" ItemHeight="24" ItemWidth="180"/>
				</ItemsPanelTemplate>
			</ComboBox.ItemsPanel>
		</ComboBox>
	</DataTemplate>

	<ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="OverlayImageValues">
		<ObjectDataProvider.MethodParameters>
			<x:Type TypeName="moc:CursorOverlay" />
		</ObjectDataProvider.MethodParameters>
	</ObjectDataProvider>

	<DataTemplate x:Key="OverlayImagePickerLineTemplate">
		<ComboBox SelectedValue="{Binding StringValue, Converter={StaticResource StringToOverlayImageConverter}}" ItemsSource="{Binding Source={StaticResource OverlayImageValues}}">
			<ComboBox.ItemTemplate>
				<DataTemplate>
					<StackPanel Orientation="Horizontal">
						<Canvas Background="Transparent" Width="20" Height="20" ToolTip="{Binding}">
							<moc:IconMockup  Width="20" Height="20" IconImage="{Binding Converter={StaticResource OverlayImageToIconImageConverter}}" Background ="White" BorderBrush="Black" Foreground="Gray"/>
						</Canvas>
						<TextBlock Text="{Binding}" Padding="8,4,0,0"/>
					</StackPanel>
				</DataTemplate>
			</ComboBox.ItemTemplate>
		</ComboBox>
	</DataTemplate>

</ResourceDictionary>
